﻿using KingerRobot.MexicoSailunMDC.Dao;
using KingerRobot.MexicoSailunMES.Spi.DTO;

namespace KingerRobot.MexicoSailunWMS.Spi;

public interface ICuringManageService
{
    /// <summary>
    /// 
    /// </summary>
    /// <param name="requestTimePara"></param>
    /// <returns></returns>
    List<RequestTimeBean> GetRequestTime(RequestTimePara requestTimePara);

    /// <summary>
    /// 出库跟踪异常
    /// </summary>
    /// <param name="requestTimePara"></param>
    /// <returns></returns>
    List<RequestTimeBean> GetExceptionRequestTime(RequestTimePara requestTimePara);

    /// <summary>
    /// 获取硫化排信息
    /// </summary>
    /// <returns></returns>
    List<CuringDitch> GetCuringDitches();
    /// <summary>
    /// 获取所有硫化机编号
    /// </summary>
    /// <returns></returns>
    List<string> GetCuringCodes();
    /// <summary>
    /// 获取硫化机编号 和 左右模
    /// </summary>
    /// <param name="taskNo"></param>
    /// <returns></returns>
    CuringBean GetCuringMode(int taskNo);
    /// <summary>
    /// 生产添加完成请料信息
    /// </summary>
    /// <param name="curingBean"></param>
    /// <returns></returns>
    int AddCuringMesBean(CuringBean curingBean);
    /// <summary>
    /// 获取硫化机状态信息
    /// </summary>
    /// <param name="curingEquipPara"></param>
    /// <returns></returns>
    List<CuringEquipBean> GetCuringEquipBeans(CuringEquipPara curingEquipPara);
    /// <summary>
    /// 硫化请料
    /// </summary>
    /// <param name="curingCallPara"></param>
    /// <returns></returns>
    List<CuringCallBean> GetCuringCallBeans(CuringCallPara curingCallPara);

    /// <summary>
    /// 硫化放胎位
    /// </summary>
    /// <returns></returns>
    List<CuringLocBean> GetCuringLocBeans();

    /// <summary>
    /// 硫化排查询
    /// </summary>
    /// <returns></returns>
    List<CuringDitchBean> CuringDitchBeans();
    /// <summary>
    /// 暂停
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    int UpdateDitchSuspend(long id);
    /// <summary>
    /// 停止
    /// </summary>
    /// <param name="id"></param>
    /// <returns></returns>
    int UpdateDitchStop(long id);
    /// <summary>
    /// 修改硫化排限制数量
    /// </summary>
    /// <param name="updateCuringParam"></param>
    /// <returns>
    /// 0:失败
    /// -1：没有参数
    /// -2：数量大于等于0
    /// </returns>
    int UpdateCuringDitchCount(UpdateCuringParam updateCuringParam, long userId, string userName, string clientHost);


    /// <summary>
    /// 获取和设置请料开关
    /// </summary>
    /// <returns></returns>
    string GetCuringCallMaterial();
    int SetCuringCallMaterial(string value);
    //根据硫化排获取
    List<CuringDetailsBean> GetCuringDetailsByDitch(long ditchId);
    /// <summary>
    /// 
    /// </summary>
    List<CuringTaskCountBean> GetCuringDitchesTask(DateTime BeginDate, DateTime EndDate);


    List<POWmsPriorityCuring> GetAllPriorityCurings(priorityCuringParam param);
    int DeletePriorityCuringById(long Id);
    int AddPriorityCuringById(priorityCuringParam param);
    int UpdatePriorityCuringById(priorityCuringParam param);

    List<POWcsManualCuringRecord> GetManualCuringRecord(manualCuringParam param);

    List<TcmInfo> GetInCuringInfos(inCuringParam param);

}
public class inCuringParam 
{
    public string TcmNo { get; set; }
}

public class manualCuringParam
{
    public DateTime? StartDate { get; set; }
    public DateTime? EndDate { get; set; }

    public string LocName { get; set; }

    public string ProductCode { get; set; }

}


public class RequestTimePara
{
    public DateTime? BeginDate { get; set; }
    public DateTime? EndDate { get; set; }
    public string CuringCode { get; set; }//硫化机编号

    public string CuringName { get; set; }//硫化机名称

    public string ProductCode { get; set; }//产品条码

    public string ExceptionType { get; set; }//异常类型

    public int PageIndex { get; set; }

    public int PageSize { get; set; }

}
//--机台，条码,SPEC，上次请料时间，请料时间，任务生成时间，堆垛机开始时间，堆垛机完成时间，到达旋转扫描，旋转扫描任务下发，EMS开始，EMS结束，异常内容
public class RequestTimeBean
{
    /// <summary>
    /// 机台编号
    /// </summary>
    public string CuringCode { get; set; }
    /// <summary>
    /// 机台名称
    /// </summary>
    public string CuringName { get; set; }
    /// <summary>
    /// 左右膜
    /// </summary>
    public string CuringMode { get; set; }

    public int Signs { get; set; }

    public int Indexs { get; set; }
    /// <summary>
    /// 条码
    /// </summary>
    public string ProductCode { get; set; }
    /// <summary>
    /// SPEC
    /// </summary>
    public string Spec { get; set; }
    /// <summary>
    /// 上次请料时间
    /// </summary>
    public string UpTime { get; set; }
    /// <summary>
    /// 上次请料完成时间
    /// </summary>
    public string FinishTime { get; set; }
    /// <summary>
    /// 请料时间
    /// </summary>
    public string CallTime { get; set; }
    /// <summary>
    /// 任务生成时间
    /// </summary>
    public string TaskTime { get; set; }
    /// <summary>
    /// 堆垛机开始时间
    /// </summary>
    public string CrnStartTime { get; set; }
    /// <summary>
    /// 堆垛机完成时间
    /// </summary>
    public string CrnEndTime { get; set; }


    public long CrnTime { get; set; }

    /// <summary>
    /// 到达旋转扫描
    /// </summary>
    public string ScannerTime { get; set; }
    /// <summary>
    /// 旋转扫描任务下发
    /// </summary>
    public string ScannerTaskTime { get; set; }
    /// <summary>
    /// EMS开始
    /// </summary>
    public string EmsStartTime { get; set; }
    /// <summary>
    /// EMS结束
    /// </summary>
    public string EmsEndTime { get; set; }

    public long EmsTime { get; set; }
    /// <summary>
    /// 异常内容
    /// </summary>
    public string Message { get; set; }
    /// <summary>
    /// 实时库存
    /// </summary>
    public string Stock { get; set; }

    /// <summary>
    /// 异常类型
    /// </summary>
    public string ExceptionType { get; set; }
}
public class UpdateCuringParam
{
    public long id { get; set; }
    /// <summary>
    /// 数量
    /// </summary>
    public int count { get; set; }

    public string Remark { get; set; }
}
public class CuringBean
{
    /// <summary>
    /// 条码
    /// </summary>
    public string BarCode { get; set; }
    /// <summary>
    /// 硫化机编号
    /// </summary>
    public string CuringCode { get; set; }
    /// <summary>
    /// 左右模
    /// </summary>
    public string Mode { get; set; }
    /// <summary>
    /// 是否喷涂
    /// </summary>
    public bool Spray { get; set; }
    /// <summary>
    /// 作业指示编号
    /// </summary>
    public string Serno { get; set; }
}
public class CuringLocBean
{
    /// <summary>
    /// 放胎位名称
    /// </summary>
    public string LocName { get; set; }
    /// <summary>
    /// 放胎位时间
    /// </summary>
    public DateTime? LocTime { get; set; }
    /// <summary>
    /// 是否有胎
    /// </summary>
    public string HasLoc { get; set; }
    /// <summary>
    /// 物料Spec码
    /// </summary>
    public string Spec { get; set; }
    /// <summary>
    /// 物料代码
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 硫化机名称
    /// </summary>
    public string CuringName { get; set; }
    /// <summary>
    /// 硫化机左右模
    /// </summary>
    public string CuringMode { get; set; }
}

public class CuringDitch
{
    /// <summary>
    /// 硫化排ID
    /// </summary>
    public long Id { get; set; }
    /// <summary>
    /// 硫化排名称
    /// </summary>
    public string DitchName { get; set; }
}
public class CuringDitchBean
{
    /// <summary>
    /// 硫化排ID
    /// </summary>
    public long Id { get; set; }
    /// <summary>
    /// 硫化排名称
    /// </summary>
    public string DitchName { get; set; }
    /// <summary>
    /// 已请料数量
    /// </summary>
    public int RealCount { get; set; }
    /// <summary>
    /// 限制数量
    /// </summary>
    public int? MaxCount { get; set; }
    /// <summary>
    /// 暂停[true]
    /// </summary>
    public bool Suspend { get; set; }
    /// <summary>
    /// 停止[true]
    /// </summary>
    public bool Stop { get; set; }

    public string Reason { get; set; }
}
public class CuringEquipPara
{
    /// <summary>
    /// 硫化排ID 
    /// </summary>
    public long? DitchId { get; set; }
    /// <summary>
    /// 硫化机编号
    /// </summary>
    public string CuringCode { get; set; }
    /// <summary>
    /// 硫化机名称
    /// </summary>
    public string CuringName { get; set; }
    /// <summary>
    /// 物料 Spec 码
    /// </summary>
    public string Spec { get; set; }
    /// <summary>
    /// 物料代码
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 硫化机是否可用
    /// </summary>
    public string EquipEnable { get; set; }
}
public class CuringEquipBean
{
    public long? Id { get; set; }
    /// <summary>
    /// 硫化机编号
    /// </summary>
    public string CuringCode { get; set; }
    /// <summary>
    /// 硫化机名称
    /// </summary>
    public string CuringName { get; set; }
    /// <summary>
    /// 硫化机左右模
    /// </summary>
    public string CuringMode { get; set; }
    /// <summary>
    /// 硫化排名称
    /// </summary>
    public string DitchName { get; set; }
    /// <summary>
    /// 是否请料
    /// </summary>
    public string CallCuring { get; set; }
    /// <summary>
    /// 物料Spec码
    /// </summary>
    public string Spec { get; set; }
    /// <summary>
    /// 物料代码
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 是否暂停
    /// </summary>
    public string Suspend { get; set; }
    /// <summary>
    /// 是否停止
    /// </summary>
    public string Stop { get; set; }
    /// <summary>
    /// 是否输送
    /// </summary>
    public string Transport { get; set; }
    /// <summary>
    /// 是否可放胎
    /// </summary>
    public string CuringEmpty { get; set; }
    /// <summary>
    /// 硫化机是否可用
    /// </summary>
    public string EquipEnable { get; set; }
}


public class CuringCallPara
{
    /// <summary>
    /// 硫化排ID 
    /// </summary>
    public long? DitchId { get; set; }
    /// <summary>
    /// 硫化机编号
    /// </summary>
    public string CuringCode { get; set; }
    /// <summary>
    /// 硫化机名称
    /// </summary>
    public string CuringName { get; set; }
    /// <summary>
    /// 物料 Spec 码
    /// </summary>
    public string Spec { get; set; }
    /// <summary>
    /// 物料代码
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 任务编号
    /// </summary>
    public int? TaskNo { get; set; }
}
public class CuringCallBean
{
    /// <summary>
    /// 硫化机编号
    /// </summary>
    public string CuringCode { get; set; }
    /// <summary>
    /// 硫化机名称
    /// </summary>
    public string CuringName { get; set; }
    /// <summary>
    /// 硫化机左右模
    /// </summary>
    public string CuringMode { get; set; }
    /// <summary>
    /// 硫化排名称
    /// </summary>
    public string DitchName { get; set; }

    /// <summary>
    /// 是否请料
    /// </summary>
    public string CallCuring { get; set; }
    /// <summary>
    /// 请料订单编号
    /// </summary>
    public string OrderCode { get; set; }
    /// <summary>
    /// 任务流水号
    /// </summary>
    public int? TaskNo { get; set; }
    /// <summary>
    /// 胎胚位置
    /// </summary>
    public string LocName { get; set; }
    /// <summary>
    /// 物料Spec码
    /// </summary>
    public string Spec { get; set; }
    /// <summary>
    /// 物料代码
    /// </summary>
    public string MaterialCode { get; set; }
    /// <summary>
    /// 订单明细ID
    /// </summary>
    public long? SummaryId { get; set; }

    /// <summary>
    /// 目标库位
    /// </summary>
    public long? TargetLoc { get; set; }
}

public class CuringDetailsBean
{
    public string CuringName { get; set; }
    public List<OutOrderSummaryKanBan> outOrderSummaryKanBans = new List<OutOrderSummaryKanBan>();

}
public class CuringTaskCountBean
{
    public long? CuringId { get; set; }
    public string CuringName { get; set; }
    public int? TaskCount { get; set; }
}

public class priorityCuringParam
{
    public long Id { get; set; }
    public string CuringCode { get; set; }
    public DateTime StartTime { get; set; }
    public DateTime EndTime { get; set; }
}